package com.haiyangwang1.lesson11;

public class Demo2 {
    public static int method2(String str,char chars){

        char[] chars1=str.toCharArray();
        for (int i =0;i<chars1.length;i++){
            if (chars1[i]==chars){
                return i;
            }
        }
        return -1;
    }

    public static void main(String[] args) {

    }
}
